﻿using UnityEngine;
using System.Collections;

public class Bullet : MonoBehaviour
{
    public float Speed = 200f;

    Rigidbody body;

    void Start()
    {
        body = GetComponent<Rigidbody>();

        Destroy(gameObject, 30);
    }

    void Update()
    {
        body.MovePosition(transform.position + transform.forward * Speed * Time.deltaTime);
    }

    void OnCollisionEnter(Collision collision)
    {
        Destroy(gameObject);
    }
}
